WebSocket is a communications protocol, providing full-duplex communication channels over a single transmission control protocol (TCP) connection. WebSocket may be implemented in browsers and servers, and may further be used by any client or server application. WebSocket is an independent TCP-based protocol. A WebSocket handshake may be interpreted by a hypertext transfer protocol (HTTP) server as an Upgrade request.
The WebSocket protocol may make more interaction between a browser and a server possible, facilitating the real-time data transfer from and to the server. This is made possible by providing a standardized way for the server to send content to the browser without being solicited by the client, and allowing for messages to be passed back and forth while keeping the connection open. In this way, a two-way (bi-directional) ongoing conversation can take place between a browser and the server.